package com.zuxia.controller;


import com.zuxia.param.CoordinateParam;
import com.zuxia.param.UserParam;
import com.zuxia.service.DumpService;
import com.zuxia.utils.R;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author laoli
 * @since 2024-11-17
 */
@RestController
@RequestMapping("/user/dump")
public class DumpController {
    @Resource
    private DumpService dumpService;

    @ApiOperation("升序排序取货点")
    @PostMapping("/near")
    public R getDumpByNear(@RequestBody CoordinateParam coordinateParam){
        return R.ok().message("查询结果").data("dump-near-all",dumpService.getDumpByNear(coordinateParam));
    }

    @ApiOperation("拼团点-单查")
    @GetMapping("/single/{id}")
    public R getDumpById(@PathVariable("id") String id){
        return R.ok().message("查询结果").data("dump-single",dumpService.getDumpById(id));
    }

}

